#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll t;
void solve(){
	ll n,j,k;
	cin>>n>>j>>k;
	ll mx=0;
	ll arr[n+1];
	ll xuan=0;
	for (int i=1;i<=n;i++){
		cin>>arr[i];
		if (j==i)xuan=arr[i];
		mx=max(mx,arr[i]);
	}
	if (k>=2 || (k==1 && mx==xuan)){
		cout<<"YES\n";
	}else{
		cout<<"NO\n";
	}
}
int main(){
	cin>>t;
	while(t--){
		solve();
	}	
	return 0;
}
